import { Module } from '@nestjs/common'
import { ConfigModule } from '@nestjs/config'
import { AuthModule } from './auth/auth.module'
import i18nMiddleware from './config/i18n'
import { WechatConfig } from './config/wechat.config'

@Module({
  imports: [
    ConfigModule.forRoot({
      isGlobal: true,
      envFilePath: '.env',
    }),
    AuthModule,
  ],
  providers: [WechatConfig],
})
export class AppModule {
  configure(consumer) {
    consumer.apply(i18nMiddleware).forRoutes('*')
  }
}
